<div id="arianne" class="span-24 last">
  <?php echo link_to('Accueil','@homepage')?>
  > <?php echo __('mes annonces') ?>
</div>

<table id="my-ads">
    <tr>
        <th><?php echo __("Titre") ?></th>
        <th><?php echo __("Catégorie") ?></th>
        <th><?php echo __("Date fin de publication") ?></th>
        <th><?php echo __("Actions") ?></th>
    </tr>
<?php
if( count($aAds) >0 ):
    foreach ($aAds as $ads):
        echo "<tr>";
        echo "<td>" . link_to( sfOutputEscaper::unescape($ads->title), '@adsDetail?subcat='.Doctrine_Inflector::urlize($ads->SubCategory->title) . '&slug='.$ads->slug ) . "</td>";
        echo "<td>" . sfOutputEscaper::unescape($ads->SubCategory->title) . "</td>";
        echo "<td>" . format_date($ads->publish_end_at,'EEEE dd. MMMM yyyy', $sf_user->getCulture()) . "</td>";
        echo "<td>";
            echo "<ul>";
            echo "<li>". link_to( __("Editer"), "@updateAds?ads_id=".$ads->id . "&slug=".__("modifier-annonce"), array("title" => __('Mettre à jour'), 'class' => "edit_icon") )."</li>";
            echo "<li>". link_to( __("Supprimer"), "@deleteAds?id=".$ads->id, array("title" => __('Supprimer'), 'class' => 'delete_icon', 'confirm'=> __('Etes-vous sûr de vouloir supprimer cette annonce ?') ) )."</li>";
            echo "</ul>";   
        echo "</td>";
        
        echo "</tr>";
    endforeach;
else:
	echo __("Vous n'avez aucune annonce activée en ligne. ");
	echo link_to( __('Voullez vous en déposer gratuitement ? '), '@adsCreate' );
endif;
    
?>
</table>